import express from 'express';


const userRouter = express.Router();

import auth from '../../common/middleware/auth'
import userController from './controller'

/**
 * 获取用户信息
 */
userRouter.get('/getUserInfo', auth.vertify, userController.getUserInfo)

/**
 * 更改用户名
 */
userRouter.put('/changeUsername', auth.vertify, userController.changeUserName)

/**
 * 更改密码
 */
userRouter.put('/changePass', auth.vertify, userController.changePass)

/**
 * 判断用户是否注册过了
 */
userRouter.get('/isRegistered', userController.isRegistered)

/**
 * 校验token是否过期了
 */
userRouter.get('/refresh', auth.vertify, userController.isTokenPass)


export default userRouter;
